/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pb138.srgsxmldb.manager;

import java.io.File;
import org.apache.commons.fileupload.FileItem;

/**
 * interface IXManager provides methods for
 * 
 * @author Eldred
 */
public interface IXManager {

    /**
     * adds grammar fromm FileItem file to folder and xml collection
     * @param file file with grammar to add
     */
    void        addGrammarFromXMLFile(FileItem file);
    
    /**
     * deletes grammar fromm FileItem file from folder and xml collection
     * @param filename name of grammar file to delete
     */
    void        deleteGrammarByFileName(String filename);
    
    /**
     * get all grammars from the collection
     * @return array of grammar file names
     */
    String[]    getAllGrammars();
    
    /**
     * get all grammas with the specific root
     * @param root root name to search by
     * @return array of grammar file names containing root from parameter
     */
    String[]    getGrammarFileNameByRoot(String root);
    
    /**
     * get root name of the specific grammar
     * @param filename name of grammar file name to search by
     * @return name of the root in the specific grammar
     */
    String      getGrammarRootByFileName(String filename);
    
    /**
     * get physical file containing srgs xml grammar
     * @param filename name of the grammar file name
     * @return file of the grammar
     */
    File        getGrammarFileByFileName(String filename);  
}
